import { post, postParams } from "../index";
// 登录
export const Login = (data) => post("/login", data);
export const Register = (data) => post("/register", data);

/**
 * 获取商品列表
 */
export const getProducts = (data) => postParams("/getProductsListMini", data)
/**
 * 获取商品评论
 * @param {*} data 
 * @returns 
 */
export const getProductsComment = (data) => post("/getProductsComment", data)


/**
 * 添加购物车
 * @param {*} data 
 * @returns 
 */
export const addCart = (data) => post("/addCart", data)

/**
 * 获取购物车的信息
 * @param {*} data 
 * @returns 
 */
export const getCart = (data) => post("/getCart", data)

/**
 * 创建订单
 * @param {*} data 
 * @returns 
 */
export const addOrder = (data) => post("/addOrder", data)
/**
 * 添加商品进订单里面
 * @param {*} data 
 * @returns 
 */
export const addOrderProducts = (data) => post("/addOrderProducts", data)

/**
 * 查询订单内容
 * @param {*} data 
 * @returns 
 */
export const queryOrder = (data) => post("/queryOrder", data)

/**
 * 修改订单
 * @param {*} data 
 * @returns 
 */
export const updateOrder = (data) => post("/updateOrder", data)


/**
 * 修改用户的余额
 * @param {*} data 
 * @returns 
 */
export const editUserBalance = (data) => post("/editUserBalance", data)

/**
 * 获取用户信息
 * @param {*} data 
 * @returns 
 */
export const getUserInfo = (data) => post("/getUserInfo", data)




